﻿using System;
using System.Diagnostics;
using System.Runtime.Serialization;

namespace CSC.Google
{
    /// <summary>
    /// The version of the Page Speed SDK used to generate these results.
    /// </summary>
    [Serializable]
    public class Version
    {
        #region Private Variables
        [OptionalField, DebuggerBrowsable(DebuggerBrowsableState.Never)]
        private int major = 0;
        [OptionalField, DebuggerBrowsable(DebuggerBrowsableState.Never)]
        private int minor = 0;
        #endregion

        /// <summary>
        /// The major version number of the Page Speed SDK used to generate these results.
        /// </summary>
        public int Major { get { return major; } }

        /// <summary>
        /// The minor version number of the Page Speed SDK used to generate these results.
        /// </summary>
        public int Minor { get { return minor; } }

        /// <summary>
        /// The version as formatted string. Example: "1.11"
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return string.Format("{0}.{1}", major, minor);
        }
    }
}
